﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BrokerBase.Lib.Policy;

namespace broker.duty.TPYRS
{
    class Class6
    {
        public void Calc200(IPolicyPeriodActing ppa, IDutyActing da)
        {

            if (ppa.SchemePeriodActing.InsurantStates.Contains("身故") || ppa.SchemePeriodActing.InsurantStates.Contains("全残"))
            {
                IPolicyPeriodActing eppa = ppa.SchemePeriodActing.GetPolicyPeriodActiing("太平洋人寿_如意安康重疾保险_附_A款");

                double efee = eppa == null ? 0 : eppa.PolicyActing.Policy.Fee;

                int pl = ppa.PolicyActing.Policy.PaymentPeriodLength;

                da.Value = (ppa.PolicyActing.Policy.Fee + efee) * pl ;
                ppa.IsCurrentFinish = true;
            }

        }

        public void Calc200(IPolicyPeriodActing ppa, IDutyActing da)
        {

           
            if (ppa.IsLastPeriod )
            {
                IPolicyPeriodActing eppa = ppa.SchemePeriodActing.GetPolicyPeriodActiing("太平洋人寿_如意安康重疾保险_附_A款");

                double efee = eppa == null ? 0 : eppa.PolicyActing.Policy.Fee;

                int pl = ppa.PolicyActing.Policy.PaymentPeriodLength;
                
                da.Value = (ppa.PolicyActing.Policy.Fee + efee)* pl * 1.05;
                ppa.IsCurrentFinish = true;
            }

        }

        //重大疾病豁免保费
        public void Calc200(IPolicyPeriodActing ppa, IDutyActing da)
        {

            if (ppa.Period > 0)
            {
                IPolicyPeriodActing pppa = ppa.PolicyActing.PeriodActings[ppa.Period - 1];

                if (pppa.SchemePeriodActing.InsurantStates.Contains("重疾"))
                {
                    ppa.Fee = 0;
                }
            }



        }

        public void Calc200(IPolicyPeriodActing ppa, IDutyActing da)
        {

            if (ppa.SchemePeriodActing.InsurantStates.Contains("重疾"))
            {
                da.Value = ppa.Amount;
                ppa.IsCurrentFinish = true;
            }

        }
    }
}
